import pymysql
# 连接到数据库
conn = pymysql.connect(host='localhost', user='root', password='151612', database='Python')
# 创建游标
cursor = conn.cursor()
# cursor.execute("SELECT * FROM MOV")  # 替换为你的实际查询语句
# cursor.execute("""INSERT INTO MOV (name, score) VALUES ("li", 1)""")
# cursor.execute("delete  from mov where id=25")
# cursor.execute("update mov set score = 6 where id=24")
cursor.execute("SELECT * FROM MOV")
# 获取查询结果
results = cursor.fetchall()
for row in results:
    print(row)
# 提交事务
conn.commit()
# 关闭连接
conn.close()
